<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>IDA SDK: Threads</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">IDA SDK
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="files.html"><span>Header&#160;Files</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Threads<div class="ingroups"><a class="el" href="group__dbg__funcs.html">Debugger functions</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Inspect/Manipulate threads of debugged process. </p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gaf6a319190ad550eb695f39598d248c46"><td class="memItemLeft" align="right" valign="top">int <a class="el" href="pro_8h.html#a6505e7ff3b129d8b17258304886fd133">idaapi</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dbg__funcs__threads.html#gaf6a319190ad550eb695f39598d248c46">get_thread_qty</a> (void)</td></tr>
<tr class="memdesc:gaf6a319190ad550eb695f39598d248c46"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get number of threads.  <a href="#gaf6a319190ad550eb695f39598d248c46">More...</a><br /></td></tr>
<tr class="separator:gaf6a319190ad550eb695f39598d248c46"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gadd9036b9eb27acc89108c6ec41bc28bd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="idd_8hpp.html#a479b4266d280e0d77b7ca914dec19122">thid_t</a> <a class="el" href="pro_8h.html#a6505e7ff3b129d8b17258304886fd133">idaapi</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dbg__funcs__threads.html#gadd9036b9eb27acc89108c6ec41bc28bd">getn_thread</a> (int n)</td></tr>
<tr class="memdesc:gadd9036b9eb27acc89108c6ec41bc28bd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the ID of a thread.  <a href="#gadd9036b9eb27acc89108c6ec41bc28bd">More...</a><br /></td></tr>
<tr class="separator:gadd9036b9eb27acc89108c6ec41bc28bd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf4d318f9496baa57975c6405e0748230"><td class="memItemLeft" align="right" valign="top"><a class="el" href="idd_8hpp.html#a479b4266d280e0d77b7ca914dec19122">thid_t</a> <a class="el" href="pro_8h.html#a6505e7ff3b129d8b17258304886fd133">idaapi</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dbg__funcs__threads.html#gaf4d318f9496baa57975c6405e0748230">get_current_thread</a> (void)</td></tr>
<tr class="memdesc:gaf4d318f9496baa57975c6405e0748230"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get current thread ID.  <a href="#gaf4d318f9496baa57975c6405e0748230">More...</a><br /></td></tr>
<tr class="separator:gaf4d318f9496baa57975c6405e0748230"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga813f28d4986ec6db2a2f3ba9934fa767"><td class="memItemLeft" align="right" valign="top">bool <a class="el" href="pro_8h.html#a6505e7ff3b129d8b17258304886fd133">idaapi</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dbg__funcs__threads.html#ga813f28d4986ec6db2a2f3ba9934fa767">select_thread</a> (<a class="el" href="idd_8hpp.html#a479b4266d280e0d77b7ca914dec19122">thid_t</a> tid)</td></tr>
<tr class="memdesc:ga813f28d4986ec6db2a2f3ba9934fa767"><td class="mdescLeft">&#160;</td><td class="mdescRight">Select the given thread as the current debugged thread.  <a href="#ga813f28d4986ec6db2a2f3ba9934fa767">More...</a><br /></td></tr>
<tr class="separator:ga813f28d4986ec6db2a2f3ba9934fa767"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7f021f1ce909ed47b4016b60b25d811c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7f021f1ce909ed47b4016b60b25d811c"></a>
bool <a class="el" href="pro_8h.html#a6505e7ff3b129d8b17258304886fd133">idaapi</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dbg__funcs__threads.html#ga7f021f1ce909ed47b4016b60b25d811c">request_select_thread</a> (<a class="el" href="idd_8hpp.html#a479b4266d280e0d77b7ca914dec19122">thid_t</a> tid)</td></tr>
<tr class="memdesc:ga7f021f1ce909ed47b4016b60b25d811c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Post a <a class="el" href="group__dbg__funcs__threads.html#ga813f28d4986ec6db2a2f3ba9934fa767" title="Select the given thread as the current debugged thread. ">select_thread()</a> request. <br /></td></tr>
<tr class="separator:ga7f021f1ce909ed47b4016b60b25d811c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabe20695ac4f3ac8f606a4d8be6e482ce"><td class="memItemLeft" align="right" valign="top">int <a class="el" href="pro_8h.html#a6505e7ff3b129d8b17258304886fd133">idaapi</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dbg__funcs__threads.html#gabe20695ac4f3ac8f606a4d8be6e482ce">suspend_thread</a> (<a class="el" href="idd_8hpp.html#a479b4266d280e0d77b7ca914dec19122">thid_t</a> tid)</td></tr>
<tr class="memdesc:gabe20695ac4f3ac8f606a4d8be6e482ce"><td class="mdescLeft">&#160;</td><td class="mdescRight">Suspend thread.  <a href="#gabe20695ac4f3ac8f606a4d8be6e482ce">More...</a><br /></td></tr>
<tr class="separator:gabe20695ac4f3ac8f606a4d8be6e482ce"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9e506f91e4d8d1431ccc3e39b45528db"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga9e506f91e4d8d1431ccc3e39b45528db"></a>
int <a class="el" href="pro_8h.html#a6505e7ff3b129d8b17258304886fd133">idaapi</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dbg__funcs__threads.html#ga9e506f91e4d8d1431ccc3e39b45528db">request_suspend_thread</a> (<a class="el" href="idd_8hpp.html#a479b4266d280e0d77b7ca914dec19122">thid_t</a> tid)</td></tr>
<tr class="memdesc:ga9e506f91e4d8d1431ccc3e39b45528db"><td class="mdescLeft">&#160;</td><td class="mdescRight">Post a <a class="el" href="group__dbg__funcs__threads.html#gabe20695ac4f3ac8f606a4d8be6e482ce" title="Suspend thread. ">suspend_thread()</a> request. <br /></td></tr>
<tr class="separator:ga9e506f91e4d8d1431ccc3e39b45528db"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga61ee8890e7018e9cea3f370c57d0a7f5"><td class="memItemLeft" align="right" valign="top">int <a class="el" href="pro_8h.html#a6505e7ff3b129d8b17258304886fd133">idaapi</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dbg__funcs__threads.html#ga61ee8890e7018e9cea3f370c57d0a7f5">resume_thread</a> (<a class="el" href="idd_8hpp.html#a479b4266d280e0d77b7ca914dec19122">thid_t</a> tid)</td></tr>
<tr class="memdesc:ga61ee8890e7018e9cea3f370c57d0a7f5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Resume thread.  <a href="#ga61ee8890e7018e9cea3f370c57d0a7f5">More...</a><br /></td></tr>
<tr class="separator:ga61ee8890e7018e9cea3f370c57d0a7f5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gacb52337754f2aeeb35aab31134b82222"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gacb52337754f2aeeb35aab31134b82222"></a>
int <a class="el" href="pro_8h.html#a6505e7ff3b129d8b17258304886fd133">idaapi</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dbg__funcs__threads.html#gacb52337754f2aeeb35aab31134b82222">request_resume_thread</a> (<a class="el" href="idd_8hpp.html#a479b4266d280e0d77b7ca914dec19122">thid_t</a> tid)</td></tr>
<tr class="memdesc:gacb52337754f2aeeb35aab31134b82222"><td class="mdescLeft">&#160;</td><td class="mdescRight">Post a <a class="el" href="group__dbg__funcs__threads.html#ga61ee8890e7018e9cea3f370c57d0a7f5" title="Resume thread. ">resume_thread()</a> request. <br /></td></tr>
<tr class="separator:gacb52337754f2aeeb35aab31134b82222"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="gaf6a319190ad550eb695f39598d248c46"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="pro_8h.html#a6505e7ff3b129d8b17258304886fd133">idaapi</a> get_thread_qty </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Get number of threads. </p>
<table class="doxtable">
<tr>
<td>Type</td><td>Synchronous function </td></tr>
<tr>
<td>Notification</td><td>none (synchronous function) </td></tr>
</table>

</div>
</div>
<a class="anchor" id="gadd9036b9eb27acc89108c6ec41bc28bd"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="idd_8hpp.html#a479b4266d280e0d77b7ca914dec19122">thid_t</a> <a class="el" href="pro_8h.html#a6505e7ff3b129d8b17258304886fd133">idaapi</a> getn_thread </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>n</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Get the ID of a thread. </p>
<table class="doxtable">
<tr>
<td>Type</td><td>Synchronous function </td></tr>
<tr>
<td>Notification</td><td>none (synchronous function) </td></tr>
</table>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">n</td><td>number of thread, is in range 0..<a class="el" href="group__dbg__funcs__threads.html#gaf6a319190ad550eb695f39598d248c46" title="Get number of threads. ">get_thread_qty()</a>-1 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="idd_8hpp.html#a3fec2238e4b2b608273f3a6c5f7a31de" title="No thread. ">NO_THREAD</a> if the thread doesn't exist. </dd></dl>

</div>
</div>
<a class="anchor" id="gaf4d318f9496baa57975c6405e0748230"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="idd_8hpp.html#a479b4266d280e0d77b7ca914dec19122">thid_t</a> <a class="el" href="pro_8h.html#a6505e7ff3b129d8b17258304886fd133">idaapi</a> get_current_thread </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Get current thread ID. </p>
<table class="doxtable">
<tr>
<td>Type</td><td>Synchronous function </td></tr>
<tr>
<td>Notification</td><td>none (synchronous function) </td></tr>
</table>

</div>
</div>
<a class="anchor" id="ga813f28d4986ec6db2a2f3ba9934fa767"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="pro_8h.html#a6505e7ff3b129d8b17258304886fd133">idaapi</a> select_thread </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="idd_8hpp.html#a479b4266d280e0d77b7ca914dec19122">thid_t</a>&#160;</td>
          <td class="paramname"><em>tid</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Select the given thread as the current debugged thread. </p>
<p>All thread related execution functions will work on this thread. The process must be suspended to select a new thread. </p><table class="doxtable">
<tr>
<td>Type</td><td>Synchronous function - available as request </td></tr>
<tr>
<td>Notification</td><td>none (synchronous function) </td></tr>
</table>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">tid</td><td>ID of the thread to select </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>false if the thread doesn't exist. </dd></dl>

</div>
</div>
<a class="anchor" id="gabe20695ac4f3ac8f606a4d8be6e482ce"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="pro_8h.html#a6505e7ff3b129d8b17258304886fd133">idaapi</a> suspend_thread </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="idd_8hpp.html#a479b4266d280e0d77b7ca914dec19122">thid_t</a>&#160;</td>
          <td class="paramname"><em>tid</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Suspend thread. </p>
<p>Suspending a thread may deadlock the whole application if the suspended was owning some synchronization objects. </p><table class="doxtable">
<tr>
<td>Type</td><td>Synchronous function - available as request </td></tr>
<tr>
<td>Notification</td><td>none (synchronous function) </td></tr>
</table>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">tid</td><td>thread id </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">-1</td><td>network error </td></tr>
    <tr><td class="paramname">0</td><td>failed </td></tr>
    <tr><td class="paramname">1</td><td>ok </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga61ee8890e7018e9cea3f370c57d0a7f5"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="pro_8h.html#a6505e7ff3b129d8b17258304886fd133">idaapi</a> resume_thread </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="idd_8hpp.html#a479b4266d280e0d77b7ca914dec19122">thid_t</a>&#160;</td>
          <td class="paramname"><em>tid</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Resume thread. </p>
<table class="doxtable">
<tr>
<td>Type</td><td>Synchronous function - available as request </td></tr>
<tr>
<td>Notification</td><td>none (synchronous function) </td></tr>
</table>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">tid</td><td>thread id </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">-1</td><td>network error </td></tr>
    <tr><td class="paramname">0</td><td>failed </td></tr>
    <tr><td class="paramname">1</td><td>ok </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</body>
</html>
